package com.tjk.crawler.service.red.service.imp;

import com.alibaba.fastjson2.JSON;
import com.tjk.crawler.service.red.service.RedService;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.springframework.stereotype.Service;

import java.io.IOException;

/**
 * @Author tangjiakai
 * @Date 2024/8/14 17:09
 */
@Service
public class RedServiceImp implements RedService {
    @Override
    public void catchRedDemo() {
        try {
            Document doc = Jsoup.connect("https://www.xiaohongshu.com/search_result?keyword=java&type=51").get();
            String html = doc.html();
            System.out.println(JSON.toJSON(html));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}
